package com.interauto.Controller.casepage;

import com.interauto.bean.web.ProjectInfoWeb;
import com.interauto.service.web.ProPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/pro")
public class ProjectHome {
    @Autowired
    private ProPageService proPageService;


    @RequestMapping(value = "/home",method = RequestMethod.GET)
    public ModelAndView home(){
        List<ProjectInfoWeb> projectInfoWebs=proPageService.getAllProjectInfoWeb();
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.setViewName("projectpage");
        System.out.println("--projectInfoWebs:"+projectInfoWebs.size());
        modelAndView.addObject("projectInfoWebs",projectInfoWebs);
        return modelAndView;
    }
}
